package com.yiyuan.weixin.weixinOutservice.dao;

import com.yiyuan.weixin.Common.GlobalConstant;
import com.yiyuan.weixin.utils.HttpUtil;

/**
 * Created by happy on 2017/8/29.
 */
public class ActionEventClick {

    public static String  actionDispatch(String keyValue){
        if (keyValue.equals(GlobalConstant.TY_KEY_BUY)){
            return actionBuy();
        }
        if (keyValue.equals(GlobalConstant.TY_KEY_BUY_BOOK)){
            return actionBuyBook();
        }
        if (keyValue.equals(GlobalConstant.TY_KEY_SELL)){
            return actionSell();
        }
        if (keyValue.equals(GlobalConstant.TY_KEY_SELL_BOOK)){
            return actionSellBook();
        }
        if (keyValue.equals(GlobalConstant.TY_KEY_HQ)){
            return HttpUtil.sendGet("https://be.huobi.com/market/detail/merged?symbol=ethcny");
        }
        return null;

    }

    private static String actionBuy(){
        return "市价买入请回复：GB-购买币种-数量\n" +
                "例买入一个比特比：GB-BTC-1\n" +
                "市价卖出请回复：MB-卖出币种-数量\n" +
                "例卖出一个比特比：MB-BTC-1";
    }
    private static String actionBuyBook(){
        return "买入请回复：GBO-购买币种-数量-价格\n" +
                "例买入一个比特比：GBO-BTC-1-30000\n" +
                "卖出请回复：MBO-卖出币种-数量-价格\n" +
                "例卖出一个比特比：MBO-BTC-1-30000";
    }
    private static String actionSell(){
        return "市价买入请回复：GB-购买币种-数量\n" +
                "例买入一个比特比：GB-BTC-1\n" +
                "市价卖出请回复：MB-卖出币种-数量\n" +
                "例卖出一个比特比：MB-BTC-1";
    }
    private static String actionSellBook(){
        return "买入请回复：GBO-购买币种-数量-价格\n" +
                "例买入一个比特比：GBO-BTC-1-30000\n" +
                "卖出请回复：MBO-卖出币种-数量-价格\n" +
                "例卖出一个比特比：MBO-BTC-1-30000";
    }


}
